import request from '@/utils/request';
/*
* 原始数据
*/
//  结算方式 查询
export function getSettleData(params) {
  return request({
    url: '/heart/KingBaseSettlementType/list',
    method: 'get',
    params
  });
}
// 收付款用途 查询
export function getPaymentData(params) {
  return request({
    url: '/heart/KingBaseReceiptPayPurpose/list',
    method: 'get',
    params
  });
}
// 币别
export function getCurrencyData(params) {
  return request({
    url: '/heart/KingBaseCurrency/list',
    method: 'get',
    params
  });
}
// 汇率体系
export function getExchangeData(params) {
  return request({
    url: '/heart/KingBaseRate/list',
    method: 'get',
    params
  });
}
// 汇率类型
export function getExchangeTypeData(params) {
  return request({
    url: '/heart/KingBaseExchangeRateType/list',
    method: 'get',
    params
  });
}
// 费用项目
export function getExpenseData(params) {
  return request({
    url: '/heart/KingBaseFee/list',
    method: 'get',
    params
  });
}
// 单据类型 左侧树
export function getDocumentData(params) {
  return request({
    url: '/heart/KingDocType/list',
    method: 'get',
    params
  });
}
// 单据类型右侧table
export function getDocumentTableData(params) {
  return request({
    url: 'heart/KingDocType/queryTable',
    method: 'get',
    params
  });
}
// 单据类型弹窗
export function getDocumentPopData(params) {
  return request({
    url: '/heart/KingDocType/list?level=' + params,
    method: 'get',
  });
}
// 银行账户
export function getBankAccountkData(params) {
  return request({
    url: '/heart/KingBankAccount/list',
    method: 'get',
    params
  });
}
// 往来单位
export function getContactData(params) {
  return request({
    url: '/heart/KingBaseTransactionsCompany/list',
    method: 'get',
    params
  });
}
// 安全库存
export function getStockData(params) {
  return request({
    url: '/heart/KingBaseSafetyStock/list',
    method: 'get',
    params
  });
}
// 成本
export function getCostData(params) {
  return request({
    url: '/heart/KingBaseCostCenter/list',
    method: 'get',
    params
  });
}
// 银行
export function getBankData(params) {
  return request({
    url: '/heart/KingBaseBank/list',
    method: 'get',
    params
  });
}
// 供应商
export function getSupplierData(params) {
  return request({
    url: `/heart/Supplier/list`,
    method: 'get',
    params
  });
}

//add
export function add(data, name) {
  return request({
    url: `/heart/${name}`,
    method: 'post',
    data
  });
}
//edit
export function edit(data, name) {
  return request({
    url: `/heart/${name}`,
    method: 'put',
    data
  });
}
//delete
export function del(id, name) {
  return request({
    url: `/heart/${name}/` + id,
    method: 'delete',
  });
}
// 客户
export function getCustomerList(query) {
  return request({
    url: '/heart/Customer/list',
    method: 'get',
    params: query
  });
}
// 仓库
export function getWareList(query) {
  return request({
    url: '/heart/Warehouse/list',
    method: 'get',
    params: query
  })
}
// 税率
export function getTaxData(query) {
  return request({
    url: '/heart/KingBaseTaxRate/list',
    method: 'get',
    params: query
  })
}
// 供应商分组
export function getGroupData(query) {
  return request({
    url: '/heart/KingBaseSupplierGroup/list',
    method: 'get',
    params: query
  })
}
// 采购组 || 业务组
export function getPurchaseData(query) {
  return request({
    url: '/heart/KingBaseBusinessGroup/list',
    method: 'get',
    params: query
  })
}
// 默认价目表
export function getPriceData(query) {
  return request({
    url: '/heart/KingPurchasePrice/list',
    method: 'get',
    params: query
  })
}
// 付款条件
export function getPayData(query) {
  return request({
    url: '/heart/KingBaseReceiptCondition/list',
    method: 'get',
    params: query
  })
}
// 联系人
export function getSupplyContact(query) {
  return request({
    url: '/heart/KingBaseContacts/list',
    method: 'get',
    params: query
  })
}
// 付款方式
export function getPayType(query) {
  return request({
    url: '/heart/PayType/list',
    method: 'get',
    params: query
  })
}
// 计价单位
export function getUnitData(query) {
  return request({
    url: '/heart/KingBaseMeteringUnit/list',
    method: 'get',
    params: query
  })
}
// 税收编码 /heart/kingBaseTaxType/list
export function getkingBaseTaxTypeData(query) {
  return request({
    url: '/heart/kingBaseTaxType/list',
    method: 'get',
    params: query
  })
}
// 导出数据 /heart/kingBaseTaxType/download
export function downloadData(query) {
  return request({
    url: '/heart/kingBaseTaxType/download',
    method: 'get',
    params: query
  })
}
// 导入/heart/kingBaseTaxType/excel
export function kingBaseTaxTypeexcel(data) {
  return request({
    url: `/heart/kingBaseTaxType/excel`,
    method: 'post',
    data
  });
}
// 供应商联系人
export function getSupplierContact(query) {
  return request({
    url: '/heart/SupplierContacts/list',
    method: 'get',
    params: query
  })
}
// 行业
export function getIndustryData(query) {
  return request({
    url: '/heart/Industry/list',
    method: 'get',
    params: query
  })
}